//
// MyGame.cpp for  in /home/gomes_m//workzone/test/gdl
// 
// Made by mickael gomes
// Login   <gomes_m@epitech.net>
// 
// Started on  Tue Apr 30 15:44:30 2013 mickael gomes
// Last update Sat May 18 12:35:35 2013 mickael gomes
//

#include	<cstdlib>
#include	<iostream>
#include	<GL/gl.h>
#include	<GL/glu.h>
#include	<curses.h>
#include	"MyGame.hh"

void MyGame::initialize(void)
{
  window_.create();
  camera_.initialize();
  menu.initialize("images/FF8emulationissue.png", -900, 660, 830, -630, -1);
  cursor.initialize("images/FF8Cursor.png", -320, -350, -250, -410, 0);
}

void MyGame::update(void)
{
  if (input_.isKeyDown(gdl::Keys::Escape) == true)
    {
      window_.setFullscreen(0);
      exit(EXIT_SUCCESS);
    }
  cursor.update(gameClock_, input_);
}

void MyGame::draw(void)
{
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glClearColor(0.00f, 0.00f, 0.00f, 0.00f);
  glClearDepth(1.0f);

  cursor.texture_.bind();
  cursor.draw();
  menu.texture_.bind();
  menu.draw();
  this->window_.display();
}

void MyGame::unload(void)
{
}
